package com.test.controller;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.struts.action.Action;
import com.struts.form.Form;
import com.test.pojo.User;

public class UserAction implements Action {

	@Override
	public String execute(HttpServletRequest request,
			HttpServletResponse response, Form form,
			Map<String, String> actionForward) {

		User user = (User)form;
		
		String url = "fail";
		
		if(user.getUsername().equals(user.getPassword())){
			
			url = "success";
		}
		
		return actionForward.get(url);
	}

}
